package com.baoxin.chenxixc4coach;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

public class MyCarActivity extends BaseActivity {

    private LinearLayout mCarInfoLL;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_car);
        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayShowTitleEnabled(false);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        mCarInfoLL = findViewById(R.id.cars_ll);
        onCreateCarInfoView();
    }

    private void onCreateCarInfoView() {
        LinearLayout carView = (LinearLayout) LayoutInflater.from(this).
                inflate(R.layout.car_info, mCarInfoLL, true);
        TextView carType = carView.findViewById(R.id.car_type);
        TextView carNumber = carView.findViewById(R.id.car_number);
        TextView carStudentNum = carView.findViewById(R.id.student_number);
        TextView carFixNum = carView.findViewById(R.id.fix_times);

        carView.findViewById(R.id.show_student).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });

        carView.findViewById(R.id.fix_detail).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
    }

    /**
     * 添加车辆
     *
     * @param view
     */
    public void onAddCar(View view) {
    }
}
